
<?php 
	$ar = $this->get("crDocument");
?>
<form method="post" action="<?php _e(actionUrl($this))?>" onsubmit="return ajax_form(this)" id="task-form" enctype="multipart/form-data">
<input type="hidden" name="ID" value="<?php _e($post['ID'])?>"/>

<div class="x-list-title">
		<table width="100%" border="0" height="100%">
		<tr>
			<td align="left">
				<h2>
                <?php _e($ar['title'])?>
				</h2>
			</td>
			<td align="right">	
                <div class="x-list-options">
						<div class="x-options-container">
							<a class="x-button"> Tác vụ khác <span>&#9660;</span></a>
							<div class="x-options">
							<a href="#Document/Indexp/edit?ID=<?php _e($ar['ID']);?>" class="x-options-item">Sửa tài liệu</a>
							<a onclick="module_delete('<?php _e(BASE_URL)?>/Document/Indexp/delete?ID=<?php _e($ar['ID']);?>')" class="x-options-item">Xóa tài liệu</a>
        					<a class="x-options-item" onclick="load_inframe('<?php _baseUrl();?>/Document/Indexp/forward?ID=<?php _e($ar['ID']);?>',{title: 'Chuyển tiếp tài liệu',css_content:{width:'300px',height:'400px'},auto_hidden: true })">Chuyển tiếp</a>
        				    
        					<a onclick="load_inframe('<?php _baseUrl();?>/Document/Index/save?ID=<?php _e($ar['ID']);?>',{title: 'Chọn thư mục để lưu tài liệu',css_content:{width:'300px'},auto_hidden: true })" class="x-options-item" >Lưu</a>
        					<a class="x-options-item" onclick="window.print();">In tài liệu</a>
							</div>
						</div>
					</div>
			</td>
		</tr>
		</table>	
</div>
<div class="x-info">
	<table width="100%" cellpadding="7" class="x-info">
		<tr>
			<td colspan="4" align="right" class="x-info-top">
				<span class="tl">Thông tin chi tiết</span>
				<?php $topRight = $this->get('cr_update');?>
				<span class="tr">Cập nhập lần cuối lúc <?php _e( show_date('H:i:s d-m-Y',$topRight['date_updated']) );?>  bởi <a class="userlink username" href="#User/Info?ID=<?php _e($topRight['updated_by_id'])?>"> <?php _e( $topRight['updated_by_name'] );?></a></span>
			</td>
		</tr>
		<tr>
			<td class="x-info-label" >Nhóm tài liệu</td>
			<td class="x-info-content">
				
				<a href="#Document/Index/Index?type=<?php _e($ar['document_type_id']);?>"><?php _e($ar['document_type'])?></a>
			</td>
			<td class="x-info-label"><span class="x-attachment"></span></td>
			<td class="x-info-content" >
			<?php 
			$file = $this->get('files');
			if(count($file)>0){
			foreach($file as $f){?>
				<?php $a=array();?>
				<?php show_thumb( $f, baseUrl()."/Document/Index/File?ID={$f['ID']}");?>
			<?php }
				}else{
					_e("<i>Không có file đính kèm.</i>");
				}
			?>
			</td>
		</tr>
		<tr>
			<td class="x-info-label" >Người tạo</td>
			<td>
				
				<a class="userlink username" href="#User/Info?ID=<?php _e($ar['created_by_id'])?>"> <?php _e($ar['username'])?></a>
			</td>
		
			<td class="x-info-label">Ngày tạo</td>
			<td class="x-info-content">
				<?php _e(show_date(DATE_FORMAT,$ar['date_created']));?>
			</td>
		</tr>
		<tr>
			<td class="x-info-label">Chia sẻ</td>
			<td class="x-info-content" colspan="3">
				<?php
					$stringV="";
					foreach($this->get('listToSend') as $listToSend){
						$stringV.= "<a href='#User/Info?ID=".$listToSend['user_id']."'><b>".$listToSend["username"]."</b></a>,";
					}
					_e(substr($stringV,0,strlen($stringV)-1));
				?>
			</td>
		</tr>
        <tr>
			<td class="x-info-label">Nội dung</td>
			<td class="x-info-content" colspan="3">
				<?php _e($ar["content"]);?>
			</td>
		</tr>
		
	</table>
</div>
</form>